package org.moonshot.cvm;

public class CVMBlock
	implements I_ChattyCompatible
{
	public final Object     self;
	public final CVMContext context;
	public final CVMBinary  source;
	public final int        nParams;
	public final int        firstParam;
	public final int        pcInit;
	
	public CVMBlock(CVMBinary aSource, int aInit, int aFirstParam, int nParam)
	{
		self = null;
		context = null;
		source = aSource;
		pcInit = aInit;
		firstParam = aFirstParam;
		nParams = nParam;
	}
	
	public CVMBlock(Object aSelf, CVMContext aContext, CVMBlock aBasis)
	{
		self = aSelf;
		context = aContext;
		
		source = aBasis.source;
		pcInit = aBasis.pcInit;
		firstParam = aBasis.firstParam;
		nParams = aBasis.nParams;
	}
	
    public I_ChattyClass identifySelfClass (ChattyVM aVM)
    {
	    return aVM.classFor(CVMBlockClass.class);
    }
}
